/*
 * $Id: ShellApp.h,v 1.5 2005-06-28 15:23:58 bacon Exp $
 */

#ifndef _SHELLAPP_CLASS_
#define _SHELLAPP_CLASS_

#include <xpp/sys/Daemon.h>

class ShellApp: public xpp::sys::UnpausableDaemon
{
public:
	ShellApp ();
	virtual ~ShellApp ();

	int run ();
	int stop ();
	int shutdown ();

	void handleSignal (int sig);

protected:
	bool stop_requested;
	xp_pid_t parent_pid;
	xp_pid_t nanny_pid;
	xp_pid_t child_pid;

	void setup_signal_handlers ();
	void restore_signal_handlers ();
	int  run_nanny ();
	int  run_main_task ();
	void load_ini_file ();
};

#endif
